<template>
    <div>
        <van-nav-bar
            title="人气推荐"
            left-arrow
             @click-left="$router.back()"
        />
        <ul class="goods-box">
            <my-rec @click="$router.push('/goodDetail/' + item.id)" class="good-item" v-for="item in list" :key="item.id" :good="item"></my-rec>
        </ul>
    </div>
</template>

<script>
import { getGoods } from '@/api/home'
import myRec from '@/components/myRec/myRec'
export default {
    name: '',
    data() { 
        return {
            list: []
        }
    },
    components: {
        myRec
    },
    created() {
        getGoods().then(res => {
            this.list = res.data
        })
    },
    methods:{

    },
}
</script>

<style scoped>
</style>